package com.xxl.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.Random;

/**
 * 员工类
 * @author xxl
 * @date 2023/3/8
 */
@Data
@NoArgsConstructor
public class Employ {
    public String id;
    private String name;
    private int gender;
    private Department department;
    private Date  birth;
    private String email;

    public Employ(String id, String name, int gender, String email) {
        this.id = id;
        this.name = name;
        /**
         *  0 ==女 ，1 == 男
         */
        this.gender = gender;
        this.email = email;
        this.department = new Department(new Random().nextInt(9999), com.xxl.dao.Data.DEPARTMENT[new Random().nextInt(4)]);
        this.birth = new Date();
    }


    public Employ(String name, int gender, Department department, Date birth, String email) {
        this.name = name;
        this.gender = gender;
        this.department = department;
        this.birth = birth;
        this.email = email;
        this.id = "" + new Random().nextInt(9999);
    }

}
